Skip to content

Conversation

@mwb-al
Copy link
Contributor

@mwb-al mwb-al commented Jul 1, 2025

Description:

This PR refactors the conformity test suite (@conformity-batch-1) to improve code organization, readability, and maintainability. The main changes include:

What Was Removed

  • Redundant approaches for overriding Ethereum endpoints

What Was Added

  • New utils directory with modular utility functions:
    • utils.ts - Core utility functions
    • constants.ts - Test constants and configuration
    • interfaces.ts - Type definitions and interfaces
    • overwrites.ts - Override handling logic
    • processors.ts - Test data processing functions
    • validations.ts - Validation utilities
    • transactions.ts - Transaction-related utilities

Why These Changes Were Made

  1. Code Organization: Moved scattered test logic into organized, reusable modules
  2. Improved Readability: Separated concerns into logical modules
  3. Eliminated Redundancy: Unified the approach for handling Ethereum endpoint overrides (overwrites.ts)
  4. Better Maintainability: Modular structure makes it easier to maintain and extend tests

Validation Types in Override Files

The /overwrites folder contains various types of test validations:

eth_blockNumber

  • eth_blockNumber/simple-test.io - Simple block number test with wildcard result validation

eth_call

  • eth_call/call-callenv.io - Contract call with environment variables, wildcard result
  • eth_call/call-contract.io - Basic contract call test
  • eth_call/call-revert-abi-error.io - Contract call with ABI error revert
  • eth_call/call-revert-abi-panic.io - Contract call with ABI panic revert
  • eth_call/call-callenv-options-eip1559.io - Contract call with EIP-1559 options, wildcard result

eth_chainId

  • eth_chainId/get-chain-id.io - Chain ID retrieval test

eth_createAccessList

  • eth_createAccessList/create-al-contract.io - Create access list for contract interaction
  • eth_createAccessList/create-al-value-transfer.io - Create access list for value transfer
  • eth_createAccessList/create-al-contract-eip1559.io - Create access list for contract with EIP-1559

eth_estimateGas

  • eth_estimateGas/estimate-gas-contract.io - Gas estimation for contract calls
  • eth_estimateGas/estimate-gas-value-transfer.io - Gas estimation for value transfers
  • eth_estimateGas/estimate-gas-contract-eip1559.io - Gas estimation for EIP-1559 contracts

eth_feeHistory

  • eth_feeHistory/fee-history.io - Fee history with wildcards for gas ratios and base fees

eth_getBalance

  • eth_getBalance/get-balance-blockhash.io - Balance at specific block hash
  • eth_getBalance/get-balance.io - Standard balance retrieval
  • eth_getBalance/get-balance-unknown-account.io - Balance for non-existent account

eth_getBlockByHash

  • eth_getBlockByHash/get-block-by-hash.io - Block retrieval by hash

eth_getBlockByNumber

  • eth_getBlockByNumber/get-block-n.io - Block retrieval with multiple wildcard fields
  • eth_getBlockByNumber/get-finalized.io - Finalized block with hash and timestamp wildcards
  • eth_getBlockByNumber/get-latest.io - Latest block with dynamic fields
  • eth_getBlockByNumber/get-genesis.io - Genesis block with dynamic fields
  • eth_getBlockByNumber/get-safe.io - Safe block with wildcard result

eth_getBlockTransactionCountByNumber

  • eth_getBlockTransactionCountByNumber/get-genesis.io - Genesis block transaction count with wildcard

eth_getCode

  • eth_getCode/get-code-contract.io - Contract code retrieval
  • eth_getCode/get-code-empty.io - Empty contract code test

eth_getLogs

  • eth_getLogs/no-topics.io - Log query with invalid address parameter error
  • eth_getLogs/contract-addr.io - Log query with invalid topics parameter error

eth_getProof

  • eth_getProof/get-account-proof-blockhash.io - Account proof with unsupported method error

eth_getStorageAt

  • eth_getStorageAt/get-storage.io - Contract storage retrieval
  • eth_getStorageAt/get-storage-invalid-key.io - Invalid storage key error

eth_getTransactionByBlockHashAndIndex

  • eth_getTransactionByBlockHashAndIndex/get-transaction-by-block-hash-and-index.io - Transaction by block hash and index

eth_getTransactionByBlockNumberAndIndex

  • eth_getTransactionByBlockNumberAndIndex/get-transaction-by-block-number-and-index.io - Transaction by block number and index

eth_getTransactionByHash

  • eth_getTransactionByHash/get-transaction-by-hash.io - Transaction retrieval by hash

eth_getTransactionCount

  • eth_getTransactionCount/get-nonce.io - Account nonce retrieval

eth_getTransactionReceipt

  • eth_getTransactionReceipt/get-access-list.io - Transaction receipt for access list transactions
  • eth_getTransactionReceipt/get-blob-tx.io - Transaction receipt for blob transactions
  • eth_getTransactionReceipt/get-dynamic-fee.io - Transaction receipt for dynamic fee transactions
  • eth_getTransactionReceipt/get-legacy-contract.io - Transaction receipt for legacy contract transactions
  • eth_getTransactionReceipt/get-legacy-input.io - Transaction receipt for legacy input transactions
  • eth_getTransactionReceipt/get-legacy-receipt.io - Transaction receipt for legacy receipt transactions

eth_sendRawTransaction

  • eth_sendRawTransaction/send-access-list-transaction.io - Send access list transaction
  • eth_sendRawTransaction/send-blob-tx.io - Send blob transaction
  • eth_sendRawTransaction/send-dynamic-fee-access-list-transaction.io - Send dynamic fee access list transaction
  • eth_sendRawTransaction/send-dynamic-fee-transaction.io - Send dynamic fee transaction
  • eth_sendRawTransaction/send-legacy-transaction.io - Send legacy transaction

The list includes all endpoints that required modifications - even if only due to the fact that the transactions from chain.rlp are not replayed before the tests start - in order for them to pass successfully.

Related issue(s):
Fixes #3886

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

mwb-al added 19 commits July 1, 2025 14:35
…lob-related fields and improved wildcard handling (hiero-ledger#3886)

Signed-off-by: Michał Walczak <[email protected]>
…er handling and added overrides for enhanced modularity (hiero-ledger#3886)

Signed-off-by: Michał Walczak <[email protected]>
… expand transaction receipt test overrides (hiero-ledger#3886)

Signed-off-by: Michał Walczak <[email protected]>
@mwb-al mwb-al marked this pull request as ready for review July 7, 2025 14:28
@mwb-al mwb-al requested review from a team as code owners July 7, 2025 14:28
@mwb-al mwb-al requested a review from simzzz July 7, 2025 14:28
@quiet-node quiet-node removed the enhancement New feature or request label Jul 14, 2025
@quiet-node quiet-node added this to the 0.70.0 milestone Jul 14, 2025
@simzzz simzzz self-requested a review July 16, 2025 14:41
simzzz
simzzz previously approved these changes Jul 16, 2025
@acuarica acuarica modified the milestones: 0.70.0, 0.71.0 Jul 21, 2025
@mwb-al
Copy link
Contributor Author

mwb-al commented Jul 22, 2025

@acuarica
This PR is related to removing the conformity-batch-1 from the list of skipped tests.
We noticed that the github workflow shows 12 failing tests in batch-2 link

Would you prefer to fix these tests here, or mark them as skipped and create a new gh issue for this?

@acuarica
Copy link
Contributor

@mwb-al thanks for taking care of this.

Would you prefer to fix these tests here, or mark them as skipped and create a new gh issue for this?

Given the size of this PR, I believe it would be better to mark them as skipped and fix them in a follow up PR.

@arianejasuwienas arianejasuwienas added the ArianeLabs Items ArianeLabs is contributing to label Jul 23, 2025
@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

❌ Your project check has failed because the head coverage (46.58%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (c1d635a) and HEAD (5025ce4). Click for more details.

HEAD has 22 uploads less than BASE
Flag BASE (c1d635a) HEAD (5025ce4)
config-service 1 0
19 1
relay 1 0
server 1 0
ws-server 1 0
@@             Coverage Diff             @@
##             main    #3887       +/-   ##
===========================================
- Coverage   89.63%   46.58%   -43.05%     
===========================================
  Files          87       81        -6     
  Lines        4989     4675      -314     
  Branches     1004      955       -49     
===========================================
- Hits         4472     2178     -2294     
- Misses        264     2178     +1914     
- Partials      253      319       +66     
Flag Coverage Δ
config-service ?
relay ?
server ?
ws-server ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 66 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mwb-al
Copy link
Contributor Author

mwb-al commented Jul 24, 2025

@acuarica
Tests 2–5 depend on Test 1, so after the recent changes to the network state in Test 1, Tests 2–5 started failing. We've decided to introduce changes in batches, starting with this PR which focuses only on fixing Test 1.

I've commented out the other dependent tests for now, since using .skip caused Codacy to raise issues about high cyclomatic complexity and excessive method length.

At the moment, Codacy is reporting decreased test coverage as the main issue. Is there a way to either temporarily lower the test coverage threshold, or mark the affected tests as ignored (e.g., in codecov.yml) while we’re in the process of updating the full set of conformity tests? This would let us merge updates step by step.

@acuarica
Copy link
Contributor

Note that the codecov workflow is not required. You can still merge this even is the codecov workflow is failing. No need to change anything in the codecov config.

[..] is reporting decreased test coverage as the main issue.

Aside note, it looks like codecov is not working properly here given the magnitude in the decrease of code coverage. We are taking at look at improving codecov workflow.

@acuarica
Copy link
Contributor

@mwb-al if all @konstantinabl's comments are addressed, feel free to resolve them so we can move forward.

Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM great effort!

@mwb-al
Copy link
Contributor Author

mwb-al commented Jul 25, 2025

@acuarica
All the issues have been resolved. Should I take any action to proceed with merging this PR, for example, should I click "Dismiss review" for @konstantinabl, as it seems to be blocking the merge?

@acuarica
Copy link
Contributor

Given it's not a priority, let's wait until Monday so we can have more eyes on this. So no need to Dismiss review.

@konstantinabl
Copy link
Contributor

@mwb-al Why are we creating locally all the files from the execution apis, instead of fetching them as we used to?

@mwb-al
Copy link
Contributor Author

mwb-al commented Jul 29, 2025

@konstantinabl
We’re creating the necessary execution-apis files locally to override specific requests for compatibility with Hedera.
Previously, there were two less maintainable approaches: modifying requests by method name using if statements, or using filename-based switch logic.
Now, overrides are centralized and aligned with the node_modules/execution-apis/tests structure, with all request modifications handled cleanly in a single utility file.
This improves readability, maintainability, and ensures only the required files are customized.

@konstantinabl
Copy link
Contributor

@konstantinabl We’re creating the necessary execution-apis files locally to override specific requests for compatibility with Hedera. Previously, there were two less maintainable approaches: modifying requests by method name using if statements, or using filename-based switch logic. Now, overrides are centralized and aligned with the node_modules/execution-apis/tests structure, with all request modifications handled cleanly in a single utility file. This improves readability, maintainability, and ensures only the required files are customized.

I think fetching directly from the execution-apis is better in terms of staying in sync with what tests are in the repo there and in case any new endpoints popup and we miss them. But, since you already have approvals from my colleagues and except this i really like the rest of the work you have done with splitting the logic, I will approve! Thanks, great job
cc: @acuarica @quiet-node

@mwb-al
Copy link
Contributor Author

mwb-al commented Jul 30, 2025

Thanks for the approval!

Just to clarify, I’m not copying all the files, only the ones I want to overwrite.
The code checks which version to use:

const isCustom = fs.existsSync(path.join(overwritesDirectoryPath, directory, file));
const dir = isCustom ? overwritesDirectoryPath : directoryPath;

If a file exists in the overwrites folder, it uses that one - otherwise it falls back to the original.

@arianejasuwienas arianejasuwienas merged commit 8adfff6 into hiero-ledger:main Jul 30, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ArianeLabs Items ArianeLabs is contributing to internal For changes that affect the project's internal workings but not its outward-facing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prepare Additional Conformity Test Scenarios for Execution API

6 participants